home *** CD-ROM | disk | FTP | other *** search
- Path: news.nask.org.pl!usenet
- From: flssoft@blue.maloka.waw.pl (Grzegorz (FLS))
- Newsgroups: comp.lang.c++
- Subject: Re: Passing command line params in Windows
- Date: Fri, 29 Mar 1996 19:10:59 GMT
- Organization: Research and Academic Computer Network
- Message-ID: <4jhcf7$jcu@bilbo.nask.org.pl>
- References: <4jc871$jg7@wdl1.wdl.loral.com>
- NNTP-Posting-Host: s111.maloka.waw.pl
- X-Newsreader: Forte Free Agent v0.46
-
- Chuck Gantz <chuck.gantz&globalstar.loral.com> wrote:
-
- >I have a win3.1 program that I've written, using OWL, that is designed to
- >have only one copy of the program running at once, i.e. starting the
- >program, then minimizing, then running again, just starts the original
- >program at the point where it was minimized. The program accepts command
- >line parameters. The question is, if you pass different command line
- >parameters the second time you run the program, how do you tell the
- >application to recalculate based on the new parameters?
-
- Hi,
-
- I do not know OWL, but I guess that you know how to get all parameters
- passed to <WinMain()> function.
-
- When your program is launched the next time, you have a hPrevInstance
- != NULL. You can use <GetInstanceData()> function like that:
-
- HWND hWnd ;
-
- GetInstanceData( hPrevInstance, ( NPSTR )&hWnd, sizeof( hWnd )) ;
-
- and next, post to this window a message to recalculate like that:
-
- PostMessage( hWnd, WM_COMMAND, ID_RECALCULATE, lpCmdLine ) ;
-
- Of course ID_RECALCULATE, it's a constant, you should define yourself.
-
-
- I hope it help you,
- Regards,
-
-
-